<template>
  <div class="HouseItem" @click="$router.push('/detail/' + rentData.houseCode)">
    <div class="HouseItem_house">
      <div class="HouseItem_imgWrap">
        <img :src="'http://liufusong.top:8080'+rentData.houseImg" alt="">
      </div>
      <div class="HouseItem_content">
        <h3 class="HouseItem_title">{{rentData.title}}</h3>
        <div class="HouseItem_desc">{{rentData.desc}}</div>
        <div class="HouseItem_tag">
          <span class="tag" v-for="(item,index) in rentData.tags" :key="index">{{item}}</span>
        </div>
        <div class="HouseItem_price">
          <span>{{rentData.price}}</span> 元/月
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HouseItem',
  data () {
    return {

    }
  },
  props: {
    rentData: {
      type: Object,
      required: true
    }
  },
  created () {

  },

  methods: {

  }
}
</script>

<style scoped lang='less'>
.HouseItem{
  .HouseItem_house{
    padding-top: 18px;
    height: 120px;
    box-sizing: border-box;
    border-bottom: 1px solid #e5e5e5;

    .HouseItem_imgWrap{
      float: left;
      width: 106px;
      height: 80px;
      img{
        width: 100%;
        height: 100%;
      }
    }
    .HouseItem_content{
      overflow: hidden;
      // height: 88px;
      padding-left: 12px;
      line-height: 22px;
      font-family: "Microsoft YaHei";

      .HouseItem_title{
        margin: 0;
        font-size: 15px;
        color: #394043;
        overflow:hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
      }
      .HouseItem_desc{
        font-size: 12px;
        color: #afb2b3;
      }
      .HouseItem_tag{
        font-size: 14px;
        .tag{
          &:nth-child(odd){
            color: #39becd;
            background: #e1f5f8;
          }
          &:nth-child(even){
            color: #3fc28c;
            background: #e1f5ed;
          }
        }
        span{
          display: inline-block;
          font-size: 12px;
          border-radius: 3px;
          padding: 4px 5px;
          margin-right: 5px;
          line-height: 12px;
        }
      }
      .HouseItem_price{
        font-size: 12px;
        color: #fa5741;
        span{
          font-size: 16px;
          font-weight: 700;
        }
      }
    }
  }
}
</style>
